#include <cstdio>
#include "../../common/Log.hpp"
#include "../../common/FileHelper.hpp"

int main()
{
    micromq::FileHelper helper("./aaa/bbb/ccc/b.txt");
    // helper.createFile("./aaa/bbb/ccc/b.txt");
    logDebug("file%s exists, size: %ld", helper.isExists("aaa/bbb/ccc/b.txt") ? "" : " is not", helper.size());

    helper.write("Position of the last character in the string to be considered in the search.", 0, 77);

    char buffer1[256];
    helper.readAll(buffer1);
    logDebug("%s", buffer1);

    char buffer2[256];
    helper.read(buffer2, 9, 6);
    logDebug("%s", buffer2);

    helper.write("write.", 76, 6);
    helper.append("append.", 7);

    char buffer3[256];
    helper.readAll(buffer3);
    logDebug("%s", buffer3);

    // helper.rename("aaa/bbb/ccc/b.txt");

    // helper.removeFile();
    // micromq::FileHelper::removeDir("aaa");

    return 0;
}

// 测试文本：Position of the last character in the string to be considered in the search.